Ext.define('PJ.view.trainingprogram.OldParticipantsNumList', {
    extend: 'AM.default.DefaultList',
    alias: ['widget.oldParticipantsNumList'],
    requires: [],
    isHavePage: false,
    selModel: {
	        selType: '',
	        // 设置为只能通过复选框选中行
	        checkOnly: true
	    },
    initComponent: function(){
    	var me= this;
    	this.columns = [{
            header: '单位名称',
            dataIndex: 'contrastObject',
            flex: 1,
            align: "center",
            sortable: false,
    		renderer: function(value, metaData, record){
    			metaData.tdAttr = 'data-qtip="' + value + '"';
//    			if(record.get("unitNameStatus")){
//    				metaData.style = "color:red;";
//    			}
    			return value;
    		}
        },{
        	header: '计划市级人数',
        	dataIndex: 'contrastCityValue',
            width: 90,
            align: "center",
            sortable: false,
    		renderer: function(value, metaData, record){
    			/*
    			if(!record.get("contrastCityState")){
    				metaData.style = "color:red;";
    			}
    			*/
    			return value;
    		}
        },{
        	header: '计划县级人数',
        	dataIndex: 'contrastCountyValue',
            width: 90,
            align: "center",
            sortable: false,
    		renderer: function(value, metaData, record){
    			/*
    			if(!record.get("contrastCountyState")){
    				metaData.style = "color:red;";
    			}
    			*/
    			return value;
    		}
        },{
        	header: '计划总人数',
        	dataIndex: 'contrastCountValue',
            width: 90,
            align: "center",
            sortable: false,
    		renderer: function(value, metaData, record){
    			/*
    			if(!record.get("contrastCountState")){
    				metaData.style = "color:red;";
    			}
    			*/
    			return value;
    		}
        }];
    	
        this.store = Ext.create('PJ.'+ prototype +'.trainingprogram.OldParticipantsNumList',{
        	isLoad: false
        });
        this.callParent(arguments);
        this.loadType = gj_onlineLearning_constant.loadType;//加载方式
    },
    listeners: {
		viewready: function(){
			var me = this;
			var store = this.store;
            var params = store.proxy.extraParams;
            var newParams = {
            		searchPlanId: me.up("window").planId,
//            		searchPlanId: '8a10e7f555e26ad70155e323806700d2',
            		searchApplyPlan: 2
            };
            Ext.apply(params, newParams);
            store.isLoad = true;
            store.load({
                scope: this,
                callback: function(records, operation, success) {
                    //console.log(records);
                }
            });
            // 触发权限过滤事件
            me.fireEvent("permission", this);
		}
    }
});
